import request from '@/utils/request'

// 查询知识库分片列表
export function listFragmentation(query) {
    return request({
        url: '/ai/knowledgeFragmentation/list',
        method: 'post',
        data: query
    })
}

export function listAllByKnowledgeId(knowledgeId) {
    return request({
        url: '/ai/knowledgeFragmentation/listAllByKnowledgeId/' + knowledgeId,
        method: 'get'
    })
}

export function listAllByKnowledgeFileId(knowledgeFileId) {
    return request({
        url: '/ai/knowledgeFragmentation/listAllByKnowledgeFileId/' + knowledgeFileId,
        method: 'get'
    })
}

// 查询知识库分片详细
export function getFragmentation(id) {
    return request({
        url: '/ai/knowledgeFragmentation/detail/' + id,
        method: 'get'
    })
}

// 新增知识库分片
export function addFragmentation(data) {
    return request({
        url: '/ai/knowledgeFragmentation/save',
        method: 'post',
        data: data
    })
}

// 修改知识库分片
export function updateFragmentation(data) {
    return request({
        url: '/ai/knowledgeFragmentation/update',
        method: 'put',
        data: data
    })
}

// 删除知识库分片
export function delFragmentation(id) {
    return request({
        url: '/ai/knowledgeFragmentation/remove/' + id,
        method: 'delete'
    })
}

export function queryFragmentationBySearch(id, search) {
    return request({
        url: '/ai/knowledgeFragmentation/queryFragmentationBySearch/' + id + "/" + search,
        method: 'get'
    })
}
